Microcontroller units (MCU) are widely used in electrical industries in recent years. The MCU includes instructions for manipulating behaviors of the MCU. Reduced Instruction Set Computing (RISC) microprocessors can be utilized.
Data memory of the microcontroller can be accessed in a direct addressing mode or an indirect addressing mode. In the direct addressing mode, the instruction includes an address for accessing the data memory directly. In the indirect addressing mode, the address for accessing the data memory is not contained in the instruction directly. Rather, the microcontroller may calculate an address according to an offset value in the instruction and content in a register. Therefore, the indirect addressing may be more complex than the direct addressing. However, the addressing space of the direct addressing in the conventional microcontroller may be limited. For example, a conventional instruction may have an encoding of 16-bit including an 8-bit opcode and an 8-bit operand. The 8-bit operand may include an 8-bit address. Thus, the direct addressing space of the data memory can be 0˜255. Other space of the data memory may be accessed by indirect addressing.
Additionally, the conventional microcontroller may employ a set of 8-bit working registers or a set of 16-bit working registers for arithmetic and/or logic operations. However, operations with 16-bit data may not be applied to the 8-bit working registers directly, and operations with 8-bit data may not be applied to the 16-bit working registers directly. The conventional microcontroller may require extra instructions to perform operations for translating 16-bit data to 8-bit data if 8-bit working registers are employed or transferring 8-bit data to 16-bit data if 16-bit working registers are employed.